<template>
  <div class="swiper-container">
    <div class="swiper-wrapper">
      <div class="swiper-slide" v-for="(val,ind) in swipers" :key="ind">
        <img :src="val.img" alt>
      </div>
    </div>
    <!-- 如果需要分页器 -->
    <div class="swiper-pagination"></div>
  </div>
</template>
<script>
import {mapState,mapActions} from 'vuex';
export default {
  computed: {
    ...mapState(["swipers"])
  },
  methods: {
    ...mapActions(["getData"])
  },
  mounted() {
     //轮播图
      var mySwiper = new Swiper(".swiper-container", {
      autoplay: true,
      loop: true, // 循环模式选项
      observer:true,
      observeParents:true,
      // 如果需要分页器
      pagination: {
        el: ".swiper-pagination",
        type: "bullets"
      }
    });
  },
};

</script>
<style scoped>
.swiper-container {
  width: 100%;
  height: 2.6rem;
}
.swiper-slide {
  text-align: center;
  font-size: 18px;
  width: 100%;
  height: 2.6rem;
  background: #fff;
}
img {
  width: 100%;
  height: auto;
}
</style>
